package com.keste.adf.Util;


import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;


import javax.faces.context.FacesContext;

public class AdfUtil {
    
    public static Object invokeEL(String el, Class[] paramTypes,Object[] params) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      ELContext elContext = facesContext.getELContext();
      ExpressionFactory expressionFactory =
      facesContext.getApplication().getExpressionFactory();
      MethodExpression exp =
      expressionFactory.createMethodExpression(elContext, el,
      Object.class, paramTypes);
      
      return exp.invoke(elContext, params);
      }
    
    public static Object invokeEL(String el) {
      return invokeEL(el, new Class[0], new Object[0]);
      }
}

